home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-06
/
fileow.zip
/
FILEOWN.DOC
< prev
next >
Wrap
Text File
|
1991-03-07
|
4KB
|
75 lines
FILEOWN.DOC
Company: Illinois Department of Revenue
Author: John Adkins
Date: March 7, 1991
NETWORK PROBLEM
At the Illinois Department of Revenue, a Novell Netware 386 v3.1 network
was receiving "disk full" errors when appending information to files.
The disk and users actually had over 150MB of available space. As I was
informed by Don Crawford [76702,256], a SysOp for the NetWire forum on
CompuServe, Netware will only allow a file to expand to the last 4096
byte block if the owner of the file no longer exists. We had deleted no
users recently, but we had converted from NW286 to NW386 not more than a
few weeks ago.
Upon further examination of the files causing the error message, I was
able to determine that these files had no owner listed. By using the
Novell NDIR command, these files display the owner as N/A. The Novell
FILER command shows "no owner" for the files in question. To fix the
problem, I needed to provide the file with a valid owner id. Rather
than using the FILER utility to fill all files with some value, I
decided to write a program to "claim ownership" of any file which was
not currently owned. This would not affect files that already had
owners listed where the FILER would blindly replace existing owner ids
with my own.
THE SOLUTION
Armed with Turbo C++ v1.0 and the Novell C API libraries, I proceeded to
write FILEOWN. This program will read the current directory, and determine
if each file has an owner. If the file has an owner, the file is
skipped. Otherwise, the userid of the person running the program is set
as the file's owner. As a saftey feature, passing any parameter to
FILEOWN instructs the program to only display information and the
program will not perform any updates to the file information.
NOTE TO NOVELL API PROGRAMMERS:
While writing this program, I think I discovered a bug (or at least
strange behavior) in the Novell API. Originally, I used the Novell
ScanFileInformation routine to read the server's directory. This
routine does not appear to behave normally if files exist which have no
owner. By using the Novell routines on a directory containing over 800
files, my program only finds about 120 files! I modified the program to
use Turbo C's runtime library functions findfirst and findnext routines
for reading directories. The new version of the program correctly read
the entire directory. I'm not sure if this is an intended feature or a
bug in the Novell C API, but at least I found a workable solution.
LICENSING
This program is hereby donated to the PUBLIC DOMAIN. You may use this
program in any "legal" and "moral" way that benefits society. Any use
of the source code must first involve the removal of any mention of the
Illinois Department of Revenue and John Adkins. In addition, if the
source code is modified and recompiled, the new program MUST NOT be
called FILEOWN.
DISTRIBUTION
The files FILEOWN.C, FILEOWN.EXE, and FILEOWN.DOC may be freely
distributed as long as these files are distributed as a group. Any
modifications to the source, documentation or executable files must be
FULLY and ACCURATELY documented in the file FILEOWN.DOC.
DISCLAIMER
The author of FILEOWN and the Illinois Department of Revenue make no
claims as to the suitability of this program for any purpose. The
author and the Illinois Department of Revenue assume no liability or
responsibility for the use or misuse of these files.